﻿@{
    Layout = null;
}
@model Southern.Models.Southern.Partials.UploadImageInfo
@using Southern.Common.Extensions
<!DOCTYPE html>
<html>
<head>
    <title>Upload Image</title>
    <style type="text/css">
        /* imgAreaSelect animated border style*/
        .imgareaselect-border1
        {
            background: url(content/images/border-anim-v.gif) repeat-y left top;
        }
        .imgareaselect-border2
        {
            background: url(content/images/border-anim-h.gif) repeat-x left top;
        }
        .imgareaselect-border3
        {
            background: url(content/images/border-anim-v.gif) repeat-y right top;
        }
        .imgareaselect-border4
        {
            background: url(content/images/border-anim-h.gif) repeat-x left bottom;
        }
        .imgareaselect-border1, .imgareaselect-border2, .imgareaselect-border3, .imgareaselect-border4
        {
            filter: alpha(opacity=50);
            opacity: 0.5;
        }
        .imgareaselect-handle
        {
            background-color: #fff;
            border: solid 1px #000;
            filter: alpha(opacity=50);
            opacity: 0.5;
        }
        .imgareaselect-outer
        {
            background-color: #000;
            filter: alpha(opacity=50);
            opacity: 0.5;
        }
        .imgareaselect-selection
        {
        }
        /* Styles for the image overview
-----------------------------------------------------------*/
        
        .imageContainer
        {
            margin: 10px;
            position: relative;
        }
        
        .imageBox
        {
            margin: 5px;
            float: left;
            height: 96px;
            border: 0;
            overflow: hidden;
            width: 128px;
        }
        
        .imageBox:hover
        {
            height: 104px;
            margin: 0;
            border: 1px solid #CCC;
            background: #FDFDFD;
            z-index: 1;
            width: 136px;
        }
        
        .imagePreview
        {
            height: 100%;
            display: block;
            margin: 0 auto;
        }
        
        .imageCenter
        {
            text-align: center;
            margin: 20px 0;
            font-weight: bold;
        }
        /* Styles for the image uploader
-----------------------------------------------------------*/
        #upload-choices
        {
            width: 450px;
            float: left;
        }
        
        #upload-cut
        {
            margin-left: 480px;
            padding-top: 10px;
            min-width: 150px;
        }
        
        #preview
        {
            max-width: 100%;
            display: block;
        }
        .editor-row
        {
            margin: 10px 0;
            height: 40px;
            width: 100%;
        }
        /* Styles for editor and display helpers
----------------------------------------------------------*/
        
        .waitScreen
        {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.2);
            z-index: 1000000;
        }
        .flickrImages
        {
            position: absolute;
            left: 50%;
            top: 10%;
            width: 560px;
            margin-left: -300px;
            padding: 20px;
            background: #FFF;
            border-radius: 10px;
            border: 0;
            box-shadow: 0 3px 10px #666;
        }
        
        .flickrImage
        {
            height: 96px;
            margin: 4px;
            float: left;
            cursor: pointer;
        }
        button
        {
            background: #3F9D4A;
            border: none;
            font-size: 1.2em;
            color: #FFF;
            padding: 7px 10px;
            border-radius: 4px;
            font-weight: bold;
            text-shadow: 0 1px 0 rgba(0,0,0,0.4);
            margin: 5px 0;
        }
        
        button:disabled
        {
            cursor: default;
            background: #666;
        }
        
        button:not(:disabled):hover
        {
            box-shadow: 0 0 10px #666;
            cursor: pointer;
        }
    </style>
</head>
<body>
    @using (Html.BeginForm("Index", "UploadImage", FormMethod.Post, new { enctype = "multipart/form-data" }))
    {
        @Html.HiddenFor(model => model.X)
        @Html.HiddenFor(model => model.Y)
        @Html.HiddenFor(model => model.Width)
        @Html.HiddenFor(model => model.Height)
        @Html.HiddenFor(model => model.Flickr)
        <div id="upload-choices">
            <div class="editor-row">
                <div class="editor-label">
                    @Html.EditorFor(model => model.IsUrl)
                    @Html.LabelFor(model => model.Url)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Url)
                    @Html.ValidationMessageFor(model => model.Url)
                </div>
            </div>
            <div class="editor-row">
                <div class="editor-label">
                    @Html.EditorFor(model => model.IsFlickr)
                    @Html.LabelFor(model => model.Flickr)
                </div>
                <div class="editor-field">
                    @Html.Editor("FlickrQuery")
                    @Html.ValidationMessageFor(model => model.Flickr)
                </div>
            </div>
            <div class="editor-row">
                <div class="editor-label">
                    @Html.EditorFor(model => model.IsFile)
                    @Html.LabelFor(model => model.File)
                </div>
                <div class="editor-field">
                    @Html.FileFor(model => model.File)
                    @Html.ValidationMessageFor(model => model.File)
                </div>
            </div>
            <div class="editor-row">
                @Html.ValidationSummary(true)
            </div>
        </div>
        <div id="upload-cut">
            <img alt="Field for image cutting" id="preview" src="@Url.Content("~/Content/images/empty.png")" />
        </div>
        <div class="clear">
            <button type="submit">
                Upload</button>
        </div>
    }
    <script src="@Url.Content("~/Scripts/Library/jquery-1.6.2.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Microsoft/JQuery/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Microsoft/JQuery/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Microsoft/JQuery/jquery.imgareaselect.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Microsoft/JQuery/jquery.fancyupload.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            initSelect();
        });
    </script>
</body>
</html>
